/**
 * Copyright [2015] Tianfu Ma (matianfu@gmail.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * File: main.c
 *
 * Created on: Jun 5, 2015
 * Author: Tianfu Ma (matianfu@gmail.com)
 */

#include <stdio.h>
#include <stdlib.h>
#include "../include/data_type.h"
#include "../include/errno.h"
#include "../include/alloc.h"



int main() {
    ERR_INFO * err_info;
    unsigned char * alloc_buffer;
  alloc_buffer=malloc(4096*(256+1));
  if((UINT64)alloc_buffer%4096==0)
    alloc_init(alloc_buffer,256);
  else
	alloc_init(alloc_buffer+4096-(UINT64)alloc_buffer%4096,256);
    cubeerr_write(CUBEERR_NOMEM,0, "err_string");
    err_info = cubeerr_get();
    printf("%d\n",err_info->error_code);
    printf("%d\n",err_info->error_para);
    printf("%d\n",err_info->errinfo_size);
    printf("%s\n",err_info->errinfo);
    free(alloc_buffer);
    return 0;
}
